package com.example;

import com.example.core.shiroLogin.MyExceptionResolver;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

/**
 * @author zhangzhaoyang
 * @EnableTransactionManagement启注解事务管理，等同于xml配置方式的
 * 说明：首先使用注解 @EnableTransactionManagement 开启事务支持后，
 *      然后在访问数据库的Service方法上添加注解 @Transactional 便可
 *      如：当一组数据循环插入，其中有一条失败，全部的会回滚
 *
 * @EnableFeignClients注解的作用：使用Fegin进行消费（跨系统调用接口）
 */
@EnableTransactionManagement
@SpringBootApplication
public class SpringbootDemoApplication {

	public static void main(String[] args) {
		SpringApplication.run(SpringbootDemoApplication.class, args);
	}

	@Bean
	public MyExceptionResolver myExceptionResolver() {
		return new MyExceptionResolver();
	}


}
